<template>
	<view>
		<navigator url="/pages/apiPages/weather/weather">
			<button>weather</button>
		</navigator>
		<!-- <view v-for="index in 10" style="margin: 10rpx;">
			<CustomTextView :title="dataObj.title"
							:isTop="dataObj.isTop"
							:author="dataObj.isTop"
							:comments="dataObj.comments"
							:time="dataObj.time"></CustomTextView>
		</view> -->
		<view v-for="(item,index) in datalist" style="margin: 10rpx;">
			<CustomTextView :title="item.title"
			:isTop="item.isTop" 
			:author="item.author"
			 :comments="item.comments"
				:time="item.time" 
				:images="item.imageList || []"
				:mode=item.mode
				 @click="onCustomViewClick(index)">
				<template v-slot:tips>
					<view class="slotcontent" v-if="item.showSearch">
						<text style="color: darkblue;font-weight: bold;">搜索</text>
						<text>今日金价</text>
						<text>精选好物</text>
					</view>
				</template>
			</CustomTextView>
		</view>

	</view>
</template>

<script>
	import CustomTextView from "../../../components/cardViewText.vue"
	export default {
		components: {
			CustomTextView
		},
		data() {
			return {
			
				datalist: [{
						title: "国内首个大型储能电站正式并网发电发掘的司机发大家时间覅撒低级国际奥赛",
						isTop: true,
						author: "科技日报",
						comments: 138,
						time: "2025-10-29",
						showSearch: false,
						imageList:["/static/quanzhou/city2.jpg"],
						mode: 2
						
					},
					{
						title: "新修订《食品安全法》将于明年实施发大家时间覅撒低级国际奥赛",
						isTop: true,
						author: "人民日报",
						comments: 89,
						time: "2025-10-28",
						showSearch: false,
						imageList:["/static/quanzhou/city2.jpg"],
						mode: 2
						
					},
					{
						title: "世界人工智能大会在沪开幕，多款新品首发发大家时间覅撒低级国际奥赛",
						isTop: true,
						author: "新华社",
						comments: 205,
						time: "2025-10-27",
						showSearch: true,
						imageList:["/static/quanzhou/city3.jpg"],
						mode: 2
					},
					{
						title: "加入微信交友群，喜欢就聊，找喜欢的人",
						isTop: false,
						author: "气象网",
						comments: 56,
						time: "2025-10-29",
						showSearch: false,
						imageList:["/static/quanzhou/city3.jpg","/static/quanzhou/city4.jpg","/static/quanzhou/city5.jpg"],
						mode: 3
					},
					{
						title: "国产大飞机C919完成首次跨国商业飞行发大家时间覅撒低级国际奥赛",
						isTop: false,
						author: "中国航空报",
						comments: 312,
						time: "2025-10-26",
						showSearch: true
					},
					{
						title: "研究表明：每天步行8000步可降低心血管疾病风险",
						isTop: false,
						author: "健康时报",
						comments: 73,
						time: "2025-10-28",
						showSearch: false
					},
				]
			}
		},
		methods: {
			onCustomViewClick(index){
				console.log("点击了第", index + 1,"个组件");
			}
		}
	}
</script>

<style>
	.slotcontent{
		display: flex;
		align-items: center;
		font-size: 0.8rem;
	}
	.slotcontent text {

	  margin-right: 10rpx; 
/* Adjust the space between text elements */
	}

</style>